import request from '@/config/axios'

export const getWeighListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/vadmin/inventory/weigh', params })
}

export const addWeighListApi = (data: any): Promise<IResponse> => {
  return request.post({ url: '/vadmin/inventory/weigh', data })
}

export const delWeighListApi = (data: any): Promise<IResponse> => {
  return request.delete({ url: '/vadmin/inventory/weigh', data })
}

export const putWeighListApi = (data: any): Promise<IResponse> => {
  return request.put({ url: `/vadmin/inventory/weigh/${data.id}`, data })
}

export const getWeighApi = (dataId: number): Promise<IResponse> => {
  return request.get({ url: `/vadmin/inventory/weigh/${dataId}` })
}

export const postExportWeighQueryListApi = (params: any, data: any): Promise<IResponse> => {
  return request.post({ url: `/vadmin/inventory/weigh/export/query/list/to/excel`, params, data })
}

export const getImportTemplateApi = (): Promise<IResponse> => {
  return request.get({ url: `/vadmin/inventory/weigh/download/import/template` })
}

export const postImportWeighApi = (data: any): Promise<IResponse> => {
  return request.post({
    url: `/vadmin/auth/import/Weigh`,
    headersType: 'multipart/form-data',
    data
  })
}
